package com.rongshu.view.userInfo.presenter;

import android.content.Context;

import com.rongshu.api.RetorfitService;
import com.rongshu.view.base.mvp.BasePresenter;
import com.rongshu.view.base.mvp.INetBean;
import com.rongshu.view.userInfo.entity.PostVipAuthentication;
import com.rongshu.view.userInfo.iview.AddVCertificationView;

import rx.Subscriber;

public class AddVCertificationPresenter extends BasePresenter<AddVCertificationView> {

    public AddVCertificationPresenter(Context context) {
        super(context);
    }

    /**
     * 申请加V认证
     */
    public void postVipAuthentication(int user_id, String sign, PostVipAuthentication authentication) {
        RetorfitService.postVipAuthentication(user_id, sign, authentication)
                .subscribe(new Subscriber<INetBean>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(INetBean bean) {
                        if (getView() != null) {
                            getView().onVipAuthentication(bean);
                        }
                    }
                });
    }
}
